<script setup>
import { ref, onMounted } from 'vue'
import { useUserStore } from '@/stores'
import { useGetAllTasksService } from '@/api/task'

const userStore = useUserStore()
const { userId } = userStore

// 全部任务列表
const allTasksList = ref([])

// 获取今日任务列表
const getAllTasks = async () => {
  const res = await useGetAllTasksService({ user_id: userId })
  allTasksList.value = res.data.data
  console.log('全部任务列表' + JSON.stringify(allTasksList.value))
}
// 页面加载时获取全部任务列表
onMounted(() => {
  getAllTasks()
})
</script>

<template>
  <AddTasksContent @refreshTasks="getAllTasks" :taskList="allTasksList" classifyName="全部事项"></AddTasksContent>
</template>

<style lang="less" scoped>

</style>
